class_name ComplexEffective
extends EffectiveBase


var effective_blackboard: Dictionary = {}

func _ready():
	print("child count", get_child_count())
	for child in get_children() :
		child.character = character
		print("set child character")
	
func apply():
	for e in get_children():
		var ef = e as EffectiveBase
		if has_method("before_" + ef.name()) :
			call("before_" + ef.name())
		ef.apply()
		if ef.wait :
			await ef.effective_finished
		if has_method("after_" + ef.name()) :
			call("after_" + ef.name())

func set_character(c:Character):
	super.set_character(c)
	for child in get_children() :
		child.character = character
		print("set child character")
